/**
 * @author haixuanwo
 * @email haixuanwo_clark@hotmail.com
 * @date 2021-03-25
 * @brief 学生管理类
 */

#ifndef STUDENT_H
#define STUDENT_H

#include <string>
#include <vector>

#include "mysqlite.h"

typedef struct{
    std::string name;
    int age;
    int studentID;
    int gender; // 0女，1男
    int score;  // 分数
}Student_t;

class StudentManager{
public:
    StudentManager();
    bool add_student(Student_t &student);
    bool delete_student(int studentID);
    bool select_student(int studentID);
    bool change_student(Student_t &student);
    bool match_student(int studentID, Student_t *matchedStudent = nullptr);
    bool get_all_student();
    void show_all_student();
    ~StudentManager();

private:
    std::vector<Student_t> *v_student;
    mySqlite *studentDB;
};

#endif

